import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';

toast(String msg) {
  EasyLoading.instance
    ..loadingStyle = EasyLoadingStyle.dark
    ..displayDuration = const Duration(milliseconds: 800)
    ..maskColor = Colors.black.withOpacity(0.1);
  EasyLoading.showToast(msg, maskType: EasyLoadingMaskType.custom);
}

loading({String? msg = 'loading...'}) {
  EasyLoading.instance
    ..loadingStyle = EasyLoadingStyle.dark
    ..indicatorType = EasyLoadingIndicatorType.fadingCircle
    ..indicatorSize = 45.0
    ..radius = 10.0
    ..maskType = EasyLoadingMaskType.black
    ..maskColor = Colors.black.withOpacity(0.1)
    ..displayDuration = const Duration(milliseconds: 2000);
  EasyLoading.show(status: msg);
}

dismissLoading() async {
  await EasyLoading.dismiss(animation: false);
}